package config

import (
	"zstackgo/pkg/core/config/schema"
)

type GlobalConfigVO struct {
	Id           int64
	Name         string
	Description  string
	Category     string
	DefaultValue string
	Value        string
}

func (o *GlobalConfigVO) ToConfig() *GlobalConfig {
	return &GlobalConfig{
		Category:     o.Category,
		DefaultValue: o.DefaultValue,
		Value:        o.Value,
		Name:         o.Name,
		Description:  o.DefaultValue,
	}
}

func (o *GlobalConfigVO) FromConfigSchema(c *schema.Config) *GlobalConfigVO {
	o.Category = c.Category
	o.DefaultValue = c.DefaultValue
	o.Description = c.Description
	o.Name = c.Name
	o.Value = c.Value

	return o
}
